package GUI;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

import main.Main;

//相当于配置页面，
//开机界面
//选择园区号
public class gardenGUI extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel contentPanel;
	private JTextField Tfarmid;
	private JTextField Tsavetime;
	private JTextField textField;


	public gardenGUI() {
		
		    setTitle("请选择园区号");
			setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			setBounds(100, 100, 711, 401);
			contentPanel = new JPanel();  //面板
			
			contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
			setContentPane(contentPanel);
			contentPanel.setLayout(null);
			
			
//			textField = new JTextField();
//			textField.setHorizontalAlignment(SwingConstants.CENTER);
//			textField.setFont(new Font("华文行楷", Font.BOLD | Font.ITALIC, 30));
//			textField.setForeground(new Color(0, 51, 0));
////			textField.setBackground(new Color(255, 255, 255));
//			textField.setText("大田墒情数据采集");
//			contentPanel.add(textField, BorderLayout.CENTER);
//			textField.setColumns(10);

			
			
//			Tfarmid = new JTextField();//园区信息
//			Tfarmid.setText("3");
			JComboBox Tfarmid=new JComboBox();
			Tfarmid.addItem("宁大园区");
			Tfarmid.addItem("固原园区");
			Tfarmid.addItem("荷兰园区");
			Tfarmid.addItem("银川园区");
			add(Tfarmid);
			Tfarmid.setBounds(199, 61, 90, 21);//距离左边距离、距离下面、长、宽
			contentPanel.add(Tfarmid);
//			Tfarmid.setColumns(10);
			
//			JLabel lblNewLabel = new JLabel("\u56ED\u533A\u53F7");//园区号
			JLabel lblNewLabel = new JLabel("园区");
			lblNewLabel.setBounds(77, 61, 66, 21);
			contentPanel.add(lblNewLabel);
			
			JLabel lblNewLabel_1 = new JLabel("\u5B58\u50A8\u5468\u671F");
			lblNewLabel_1.setBounds(77, 113, 54, 15);
			contentPanel.add(lblNewLabel_1);
			
			Tsavetime = new JTextField();   //转存周期
			Tsavetime.setText("40");
			Tsavetime.setBounds(199, 110, 90, 21);
			contentPanel.add(Tsavetime);
			Tsavetime.setColumns(10);
			
			JButton btnNewButton = new JButton("\u786E\u8BA4\u4FDD\u5B58");
			btnNewButton.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {
//					Main.farmid =Integer.parseInt(Tfarmid.getText());
//					Main.savetime = Integer.parseInt(Tsavetime.getText());
					Main.setfinish=true;
				}
			});
			btnNewButton.setBounds(471, 269, 93, 23);
			contentPanel.add(btnNewButton);
	}
}
